Declare Function WinsockRCmd Lib "RCMD.DLL" (ByVal RHost As String, ByVal RPort As Integer, ByVal LocalUser As String, ByVal RemoteUser As String, ByVal Cmd As String, ByVal ErrorMsg As String, ByVal ErrLen As Integer) As Integer
Declare Function RCmdRead Lib "RCMD.DLL" (ByVal hRCmd As Integer, ByVal RData As String, ByVal RCount As Integer) As Integer
Declare Function RCmdClose Lib "RCMD.DLL" (ByVal hRCmd As Integer) As Integer
Declare Function RCmdHandle Lib "RCMD.DLL" (ByVal hRCmd As Integer) As Integer
Sub Execute_Click ()
If Len(Host.Text) = 0 Or Len(Cmd.Text) = 0 Then
Beep
Host.SetFocus
Exit Sub
End If
RCmdErrorMsg$ = Space$(128)
RCmdErrorLen% = 128
RetryCount% = 0
' Execute the command. We will retry on the Winsock errors -10058 and -10061.
' These are the Shutdown and Connection Refused errors that some TCP/IP
' packages return occasionally. A retry will usually give success.